package ac.svn.accesscontrol.ui.helper.formatter;

import ac.svn.accesscontrol.store.SVNUser;
import ac.svn.accesscontrol.ui.IListItemTextFormatter;

public class UserListCellTextFormatter implements IListItemTextFormatter {

	@Override
	public String formatString(Object msgObj) {
		String text = ""; 
		if(null != msgObj)
		{
			if(msgObj instanceof SVNUser )
			{
				SVNUser  svnUser = (SVNUser) msgObj;
				text = String.format("<HTML><b>%s</b> [ %s ]</HTML>", svnUser.getName(),svnUser.getUserAlias());
			}
		}
		return text;
	}

	@Override
	public String formatToolTip(Object msgObject) {
		return formatString(msgObject);
	}

}
